/**
 * 
 */
var DataMap = (function() {
	// 初始化
	function DataMap(options) {
		this.app=options.app;
		this.map = options.map;
		this.map2d=this.map.map2d;		
		this.init();
		
	}
	//
	// 初始化
	DataMap.prototype.init = function(options) {
		var that = this;		 

        var tmpLayer = that.map2d.getlayerbyid("weather");
        if (tmpLayer == null) { 
            tmpLayer = new ol.layer.Tile({
				id:"weather",
	            source: new ol.source.XYZ({
	                wrapX: true,
	                maxZoom: 8,
	                //url:"http://localhost:6060/temp/"+that.app.time+"/{z}/{x}/{y}?key="
	                url: 'http://www.dataxiu.com:6060/temp/'+that.app.time+'/{z}/{x}/{y}?key=123456789'
	            })
	        });
            that.map2d.olmap.addLayer(tmpLayer);
        }   
           
	}
	
	/*
	 * 参数说明
	 * type
	 * name:产品名称
	 */
	DataMap.prototype.loaddata = function(options) {
		var that = this;		 
		var name=options.name;
		
        var tmpLayer = that.map2d.getlayerbyid("weather");
        if (tmpLayer == null) { 
            tmpLayer = new ol.layer.Tile({
				id:"weather",
	            source: new ol.source.XYZ({
	                wrapX: true,
	                maxZoom: 8,
	                //url:"http://localhost:6060"+name+"/"+that.app.time+"/{z}/{x}/{y}?key="
	                url: 'http://www.dataxiu.com:6060/'+name+'/'+that.app.time+'/{z}/{x}/{y}?key=123456789'
	            })
	        });
            that.map2d.olmap.addLayer(tmpLayer);
        } 
	}
	// 返回
	return DataMap;
})();
 